# -*- coding: utf-8 -*-
"""
Created on Wed Apr  1 14:03:19 2020

@author: leonidkotov
"""

import numpy as np
import matplotlib.pyplot as plt

# До фильтрации сигнала
xLine = [ 8, 16, 32, 64, 96, 128, 160, 192, 224, 256, 272, 288, 304, 320, 352, 384 ]
data = [ 
        0.0014058928366012585,
        0.001043423587609536,
        0.0006645952807956758,
        0.0004390678286543142,
        0.0004268693260590683,
        0.0003323111850542141,
        0.00031685039924493266,
        0.00030298942489326953,
        0.0002917316840239057,
        0.00030335196425298507,
        0.0002906958198234211,
        0.0002780503403601636,
        0.00027169720926227477,
        0.0002641688865717598,
        0.00025230362850297444,
        0.00024109603333396325
        ]

xLine2 = [ 8, 16, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 384 ]
data2 = [
        0.0012276259715865382,
        0.0008467097491266414,
        0.0005077240639322564,
        0.00034283863580591235,
        0.00031709168373570627,
        0.00024922594684511035,
        0.00024105838566198802,
        0.00023943140664013868,
        0.00023119734865065787,
        0.0002502529636821467,
        0.00023027022292764689,
        0.00022138608540584238,
        0.0002071194162860819
        ]

# with open('meanRms.txt', 'r') as file:
#     data = [float(value) for value in file.readlines()]

data = 10 * np.log10(data)
data2 = 10 * np.log10(data2)
    
plt.figure(figsize=(15, 7))
plt.plot(xLine, data, marker='o', label='без FIR')
plt.plot(xLine2, data2, marker='o', label='С FIR')
plt.xticks(xLine)
plt.xlabel("Кол-во нейронов в пережатом слое")
plt.ylabel("dB")
plt.legend()
plt.show()